package com.sky.mapper;

import com.sky.entity.Dish;
import com.sky.vo.DishVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author zcf
 */
@Mapper
public interface UserDishMapper {

    /**
     * 根据分类id查询菜品
     * @param categoryId
     * @return
     */
    @Select("select d.id,d.name,d.category_id,d.price,d.image,d.description,d.status,d.update_time,c.name categoryName from dish d left join category c on d.category_id=c.id where d.category_id=#{categoryId}")
    List<Dish> list(Long categoryId);
}
